package ImportData;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

import InjectData.InjectDataToHDFS;

public class Main {
	private static Logger logger=Logger.getLogger("Main");
	public static void main(String[] args) {
		DOMConfigurator.configure("log4j.xml");
		InjectDataToHDFS data=new InjectDataToHDFS();
		final File folder=new File("/backup/LogNew/adslog/2013-01-26");
		List<String> listFile=data.listFilesForFolder(folder);
		for (String fileName : listFile) {
			try {
				data.addFile(fileName);
				logger.info("inject success file:"+fileName);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				logger.info("Error",e);
			}
		}
		logger.info("inject data success");
	}
}
